/**
 * 静态代理
 */
public class UserProxy implements UserDao {

    private UserImpl target;

    public UserProxy(UserImpl userImpl) {
        this.target = userImpl;
    }

    @Override
    public void save() {
        System.out.println("开始事务...");
        target.save();
        System.out.println("提交事务...");
    }
}
